const https = require("https");

var reqUrl = "https://api.jisuapi.com/area/province?appkey=a25791133ffcf4ea"

https.get(reqUrl,(res)=>{
    var str = "";
    res.on("data",(chunk)=>{
        str += chunk;
    })
    res.on("end",()=>{
        var obj = JSON.parse(str);
        console.log(obj);
        var provinceList = obj.result; //获取obj中的result数组
        //输出所有省份的名称
        for(var i=0;i<provinceList.length; i++){
            console.log(provinceList[i]['name']);
        }
        
    })
})